package metier;

public class Mesure {
	
	private int idMesure;
	private int idIntervention;
	private float PH;
	private float KH;
	private float GH;
	private float NO2;
	private float NO3;
	private float Cl;
	private float Fe;
	private float CO2;
	private float O2;
	
	public Mesure(int idMesure, int idIntervention) {
		super();
		this.idMesure = idMesure;
		this.idIntervention = idIntervention;		
	}

	public Mesure(int idMesure, int idIntervention,float pH, float kH,
			float gH, float nO2, float nO3, float cl, float fe, float cO2,
			float o2) {
		super();
		this.idMesure = idMesure;
		this.idIntervention = idIntervention;
		PH = pH;
		KH = kH;
		GH = gH;
		NO2 = nO2;
		NO3 = nO3;
		Cl = cl;
		Fe = fe;
		CO2 = cO2;
		O2 = o2;
	}
	
	public int getIdMesure() {
		return idMesure;
	}
	public void setIdMesure(int idMesure) {
		this.idMesure = idMesure;
	}
	public float getPH() {
		return PH;
	}
	public void setPH(float pH) {
		PH = pH;
	}
	public float getKH() {
		return KH;
	}
	public void setKH(float kH) {
		KH = kH;
	}
	public float getGH() {
		return GH;
	}
	public void setGH(float gH) {
		GH = gH;
	}
	public float getNO2() {
		return NO2;
	}
	public void setNO2(float nO2) {
		NO2 = nO2;
	}
	public float getNO3() {
		return NO3;
	}
	public void setNO3(float nO3) {
		NO3 = nO3;
	}
	public float getCl() {
		return Cl;
	}
	public void setCl(float cl) {
		Cl = cl;
	}
	public float getFe() {
		return Fe;
	}
	public void setFe(float fe) {
		Fe = fe;
	}
	public float getCO2() {
		return CO2;
	}
	public void setCO2(float cO2) {
		CO2 = cO2;
	}
	public float getO2() {
		return O2;
	}
	public void setO2(float o2) {
		O2 = o2;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Float.floatToIntBits(CO2);
		result = prime * result + Float.floatToIntBits(Cl);
		result = prime * result + Float.floatToIntBits(Fe);
		result = prime * result + Float.floatToIntBits(GH);
		result = prime * result + Float.floatToIntBits(KH);
		result = prime * result + Float.floatToIntBits(NO2);
		result = prime * result + Float.floatToIntBits(NO3);
		result = prime * result + Float.floatToIntBits(O2);
		result = prime * result + Float.floatToIntBits(PH);
		result = prime * result + idIntervention;
		result = prime * result + idMesure;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Mesure other = (Mesure) obj;
		if (Float.floatToIntBits(CO2) != Float.floatToIntBits(other.CO2))
			return false;
		if (Float.floatToIntBits(Cl) != Float.floatToIntBits(other.Cl))
			return false;
		if (Float.floatToIntBits(Fe) != Float.floatToIntBits(other.Fe))
			return false;
		if (Float.floatToIntBits(GH) != Float.floatToIntBits(other.GH))
			return false;
		if (Float.floatToIntBits(KH) != Float.floatToIntBits(other.KH))
			return false;
		if (Float.floatToIntBits(NO2) != Float.floatToIntBits(other.NO2))
			return false;
		if (Float.floatToIntBits(NO3) != Float.floatToIntBits(other.NO3))
			return false;
		if (Float.floatToIntBits(O2) != Float.floatToIntBits(other.O2))
			return false;
		if (Float.floatToIntBits(PH) != Float.floatToIntBits(other.PH))
			return false;
		if (idIntervention != other.idIntervention)
			return false;
		if (idMesure != other.idMesure)
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Mesure [idMesure=");
		builder.append(idMesure);
		builder.append(", idIntervention=");
		builder.append(idIntervention);
		builder.append(", PH=");
		builder.append(PH);
		builder.append(", KH=");
		builder.append(KH);
		builder.append(", GH=");
		builder.append(GH);
		builder.append(", NO2=");
		builder.append(NO2);
		builder.append(", NO3=");
		builder.append(NO3);
		builder.append(", Cl=");
		builder.append(Cl);
		builder.append(", Fe=");
		builder.append(Fe);
		builder.append(", CO2=");
		builder.append(CO2);
		builder.append(", O2=");
		builder.append(O2);
		builder.append("]");
		return builder.toString();
	}

	public int getIdIntervention() {
		return idIntervention;
	}

	public void setIdIntervention(int idIntervention) {
		this.idIntervention = idIntervention;
	}
}